# #!/usr/bin/env Rscript

library(raster)
library(sp)
library(sf)
library(meteoland)
library(dplyr)
library(biogeo)
library(ggplot2)
library(gridExtra)

setwd("/mnt/rstudio/rstudio_wd/COVID-19-ita-hex-model/air_quality")

load(".RData")

sgt <-
  SpatialGridTopography(as(dem_ita.sp, "SpatialGrid"), 
                        elevation = dem_ita.sp$X30n000e_20101117_gmted_med300,
                        proj4string = dem_ita.sp@proj4string)

# Computationally intense!
ml <- 
  interpolationgrid(interpolator, sgt, interpolator@dates)

save(ml, file = "interpolation_meteogrid.RData")